//
//  NetworkTool.h
//
//
//  Created by admin on 17/3/2.
//  Copyright © 2017年 admin. All rights reserved.
//

#import <AFNetworking/AFNetworking.h>
#import <Foundation/Foundation.h>

#define kNetworkTool ([NetworkTool sharedInstance])

//@interface NetworkTool : NSObject//AFHTTPSessionManager
@interface NetworkTool : AFHTTPSessionManager

//下载中的内容
@property (nonatomic,strong) NSMutableArray *downloading;

@property(nonatomic,strong) NSMutableArray *downloadArray;

//单例模式类
+ (instancetype)sharedInstance;


/**
 GET获取数据的主方法
 
 @param urlString 请求地址
 @param parameters 请求参数
 @param successBlock 成功回调
 @param failureBlock 失败回调
 */
- (void)GETWithUrlString:(NSString *)urlString parameters:(id)parameters success:(void(^)(id responseObject))successBlock failure:(void(^)(NSError *error))failureBlock;
/**
 POST获取数据的主方法
 
 @param urlString 请求地址
 @param parameters 请求参数
 @param successBlock 成功回调
 @param failureBlock 失败回调
 */
- (void)POSTWithUrlString:(NSString *)urlString parameters:(id)parameters success:(void(^)(id responseObject))successBlock failure:(void(^)(NSError *error))failureBlock;
#pragma mark - 梁 老的请求方法   添加了  数据的解析
- (void)POSTWithUrlStringNew:(NSString *)urlString parameters:(id)parameters success:(void(^)(id responseObject))successBlock failure:(void(^)(NSError *error))failureBlock;

- (void)POSTFuYinWithUrlString:(NSString *)urlString input:(id)input success:(void (^)(NSDictionary *))successBlock failure:(void (^)(NSError *))failureBlock;
- (void)GetFuYinWithUrlString:(NSString *)urlString input:(id)input success:(void (^)(NSDictionary *))successBlock failure:(void (^)(NSError *))failureBlock;
///多张图片上传
-(void)uploadFuYinImagesWithUrlString:(NSString *)urlString input:(id)input dataImages:(NSArray <NSData *>*)dataImages filePath:(NSString *)filePath success:(void (^)(NSDictionary *))successBlock failure:(void (^)(NSError *))failureBlock;
#pragma mark - 一次上传多张图片
-(void)uploadMultipleImagesAtOnce :(NSString *)urlString input:(id)input dataImage:(NSArray *)imageViewArray filePath:(NSArray *)filePathArray success:(void (^)(NSDictionary *))successBlock failure:(void (^)(NSError *))failureBlock;
#pragma mark -  新的api  接口 upload
- (void)uploadFuYinWithUrlString :(NSString *)urlString input:(id)input dataImage:(NSData*)dataImage  filePath:(NSString *)filePath success:(void (^)(NSDictionary *))successBlock failure:(void (^)(NSError *))failureBlock;
#pragma mark - 圣经用了  新接口  不传用户的id
- (void)POSTFuYinWithUrlStringNoUserID:(NSString *)urlString input:(id)input success:(void (^)(NSDictionary *))successBlock failure:(void (^)(NSError *))failureBlock;
@end
